package com.nsgf.library;

import android.os.Bundle;

import androidx.annotation.Nullable;

import com.kunminx.architecture.ui.page.DataBindingConfig;
import com.kunminx.architecture.ui.state.State;
import com.nsgf.library.ui.page.BaseActivity;
import com.nsgf.library.ui.page.StateHolder;
import com.nsgf.skjz.view.MyRadioButton;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends BaseActivity {


    private LoginStates mStates;

    List<MyRadioButton> menuList;

    @Override
    protected void initViewModel() {
        mStates = getActivityScopeViewModel(LoginStates.class);

    }

    @Override
    protected DataBindingConfig getDataBindingConfig() {
        return new DataBindingConfig(R.layout.activity_nsgf_main, BR.vm, mStates);
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);



    }

    public static class LoginStates extends StateHolder {

        public final State<String> name = new State<>("");

        public final State<String> password = new State<>("");

        public final State<Boolean> loadingVisible = new State<>(false);

    }

    private MyRadioButton lastChecked;



    /**
     * 修改menu样式
     *
     * @param rb
     */
    private void modflyMenuStyle(MyRadioButton rb) {
        rb.setChecked(true);
        for (MyRadioButton menuBtn : menuList) {
            if (menuBtn != rb) {
                menuBtn.setChecked(false);
            }
        }
        lastChecked = rb;
    }
}
